<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<input type="text" id="info">
<button type="submit" id="btn1">base64加密</button>
<button type="submit" id="btn2">自定义函数加密</button>
<button type="submit" id="btn3">代码混淆</button>
<script>
    var info = document.querySelector("#info");
    var btn1 = document.querySelector("#btn1");

    btn1.onclick = function () {
        axios.get("https://httpbin.org/get", {
            params:{
                info:window.btoa(info.value)
            }
        })
        .than(function (response) {
            console.log(response)
        })
        .catch(function (error){
            console.log(error)
        })

    }

    var btn2 = document.querySelector("#btn2");

// 简单洗牌加密
function simpleShuffleEncrypt(str, key) {
    // 将字符串转换为数组
    const arr = str.split('');
    const len = arr.length;

    // 使用密钥作为随机种子
    let seed = 0;
    for (let i = 0; i < key.length; i++) {
        seed += key.charCodeAt(i);
    }

    // 简单洗牌算法
    for (let i = len - 1; i > 0; i--) {
        // 生成伪随机位置
        seed = (seed * 9301 + 49297) % 233280;
        const j = Math.floor(seed / 233280 * (i + 1));

        // 交换元素
        [arr[i], arr[j]] = [arr[j], arr[i]];
    }

    return arr.join('');
}

    btn2.onclick = function () {
        axios.get("https://httpbin.org/get", {
            params:{
                info:simpleShuffleEncrypt(info.value, 123)
            }
        })
        .then(function (response) {
            console.log(response)
        })
        .catch(function (error){
            console.log(error)
        })

    }

    var btn3 = document.querySelector("#btn3");

    function _0x17ae(){var _0xf0ff33=['2109891todKYn','22AXffwn','1750TnVxnO','9PoIXPD','4832125cNEnwh','7080108SOcCTM','4yLMcbr','15534040HgbpOf','Hello\x20World!','136RchdWt','24132ZOTGzI','11586btLdoe','12414904EYcszC'];_0x17ae=function(){return _0xf0ff33;};return _0x17ae();}function _0x15e1(_0x44df28,_0x3226c0){var _0x17ae46=_0x17ae();return _0x15e1=function(_0x15e194,_0x33ef6f){_0x15e194=_0x15e194-0x120;var _0x3dc469=_0x17ae46[_0x15e194];return _0x3dc469;},_0x15e1(_0x44df28,_0x3226c0);}(function(_0x5b1931,_0x535113){var _0x2928c3=_0x15e1,_0x36d9c8=_0x5b1931();while(!![]){try{var _0x16a225=parseInt(_0x2928c3(0x129))/0x1*(-parseInt(_0x2928c3(0x127))/0x2)+-parseInt(_0x2928c3(0x12b))/0x3+-parseInt(_0x2928c3(0x124))/0x4*(parseInt(_0x2928c3(0x122))/0x5)+-parseInt(_0x2928c3(0x128))/0x6*(parseInt(_0x2928c3(0x120))/0x7)+-parseInt(_0x2928c3(0x12a))/0x8*(-parseInt(_0x2928c3(0x121))/0x9)+parseInt(_0x2928c3(0x125))/0xa+parseInt(_0x2928c3(0x12c))/0xb*(parseInt(_0x2928c3(0x123))/0xc);if(_0x16a225===_0x535113)break;else _0x36d9c8['push'](_0x36d9c8['shift']());}catch(_0x54ae1f){_0x36d9c8['push'](_0x36d9c8['shift']());}}}(_0x17ae,0xc8bc7));function hi(_0x334de9){var _0x430897=_0x15e1;return _0x430897(0x126)+_0x334de9;}

    btn3.onclick = function () {
    axios.get("https://httpbin.org/get", {
        params:{
            info:hi(info.value)
        }
    })
    .then(function (response) {
        console.log(response)
    })
    .catch(function (error){
        console.log(error)
    })

    }
</script>
</body>
</html>